package com.dxy.dxythird.message;

import com.dxy.dxythird.service.ImageUrlService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * junfeng 2018-11-01 13:31:10 消息接收
 */
@Slf4j
@Component
public class MqReceiver {

    @Autowired
    private ImageUrlService imageUrlService;

    /**
     * 图片链接报错数据库
     *
     * @param message
     */
    @RabbitListener(queuesToDeclare = @Queue("imageUrlSave"))
    public void imageUrlSave(String message) {
        imageUrlService.addImageUrl(message);
    }


}
